/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package genotypes;

import java.util.Comparator;

/**
 *
 * @author Michał
 */
public class UnacceptableAnglesComparator implements Comparator<Angles>{

    @Override
    public int compare(Angles a1, Angles a2) {
        if(a1.getObstaclesOnTheWay() > a2.getObstaclesOnTheWay()) return 1;
        else if(a1.getObstaclesOnTheWay() < a2.getObstaclesOnTheWay()) return -1;
        else {
            if(a1.getDetourLength() > a1.getDetourLength()) return 1;
            else if(a1.getDetourLength() > a1.getDetourLength()) return -1;
            else return 0;
        }
    }
    
}
